<template>
    <div>
        <!-- 卡片视图 -->
        <el-card>
            <el-col :span="4">
                <el-button type="primary" @click="addDialogVisible = true">添加教师</el-button>
            </el-col>
            <el-table :data="rightsList" border stripe>
                <el-table-column type="index"></el-table-column>
                <el-table-column label="权限名称" prop="authName"></el-table-column>
                <el-table-column label="路径" prop="path"></el-table-column>
                <el-table-column label="权限等级" prop="level">
                    <template>
                        <el-tag>一级</el-tag>
                        <el-tag class="ml-2" type="success">Tag 2</el-tag>
                        <el-tag class="ml-2" type="info">Tag 3</el-tag>
                        <el-tag class="ml-2" type="warning">Tag 4</el-tag>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
    </div>
</template>

<script>

export default {
    data() {
        return {
            //权限列表
            rightsList: [
                {
                    id: 1,
                    authName: "炒鸡管理员",
                    path: 'admin',
                    level: '0'
                },
                {
                    id: 2,
                    authName: "教师",
                    path: 'teacher',
                    level: '1'
                },
                {
                    id: 3,
                    authName: "普通用户",
                    path: 'users',
                    level: '2'
                },
            ]
        }
    },
    created() {
        //获取所有权限
        this.getRightsList()
    },
    methods: {
        //获取权限列表
        getRightsList() {
            console.log('获取权限列表');
        }
    }
}
</script>
